import { useConfig } from "@/composables/useConfig";
import { computed, reactive, ref } from "vue";


const { getHomeConfig, getCommonConfig, loading } = useConfig();
const homeConfig = computed(() => getHomeConfig());
const commonConfig = computed(() => getCommonConfig());
export const validateUsername = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderInput}${homeConfig.value?.name}`
            )
        );
    }
    {
        callback();
    }
};
export const validatetelephone = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderInput}${homeConfig.value?.phone}`
            )
        );
    }
    {
        callback();
    }
};
export const validateidType = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderSelect}${homeConfig.value?.certificateTypeTitle}`
            )
        );
    }
    {
        callback();
    }
};

export const validateidTypeOther = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderInput}${homeConfig.value?.certificateTypeTitle}`
            )
        );
    }
    {
        callback();
    }
};
export const validategender = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderInput}${homeConfig.value?.sexTitle}`
            )
        );
    }
    {
        callback();
    }
};
export const validateage = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderSelect}${homeConfig.value?.sexTitle}`
            )
        );
    }
    {
        callback();
    }
};
export const validateaddressInfo = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderSelect}${homeConfig.value?.regionTitle}`
            )
        );
    }
    {
        callback();
    }
};
export const validateaddress = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(new Error(`${commonConfig.value?.placeholderSelect}`));
    }
    {
        callback();
    }
};
export const validatejobTypeList = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderSelect}${homeConfig.value?.workTypeTitle}`
            )
        );
    }
    {
        callback();
    }
};
export const validatejobTypeOther = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(new Error(`${commonConfig.value?.placeholderInput}`));
    }
    {
        callback();
    }
};
export const validatelicenseList = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderSelect}${homeConfig.value?.professionalLicenseTitle}`
            )
        );
    }
    {
        callback();
    }
};
export const validatelicenseOther = (rule: any, value: any, callback: any) => {
    if (!value) {
        callback(
            new Error(
                `${commonConfig.value?.placeholderInput}`
            )
        );
    }
    {
        callback();
    }
};

export const validatejobDayList = (rule: any, value: any, callback: any) => {
  if (!value) {
    callback(
      new Error(
        `${commonConfig.value?.placeholderSelect}${homeConfig.value?.workDayTitle}`
      )
    );
  }
  {
    callback();
  }
};

export const validatejobTimeList = (rule: any, value: any, callback: any) => {
  if (!value) {
    callback(
      new Error(
        `${commonConfig.value?.placeholderSelect}${homeConfig.value?.workDayTitle}`
      )
    );
  }
  {
    callback();
  }
};

export const validatejobTimeOther = (rule: any, value: any, callback: any) => {
  if (!value) {
    callback(
      new Error(
         `${commonConfig.value?.placeholderInput}`
      )
    );
  }
  {
    callback();
  }
};
export const validatejobAddressList = (rule: any, value: any, callback: any) => {
  if (!value) {
    callback(
      new Error(
          `${commonConfig.value?.placeholderSelect}${homeConfig.value?.workAreaTitle}`
      )
    );
  }
  {
    callback();
  }
};

export const validatejobAddressInfoList = (rule: any, value: any, callback: any) => {
  if (!value) {
    callback(
      new Error(
         `${commonConfig.value?.placeholderSelect}`
      )
    );
  }
  {
    callback();
  }
};